defmodule ProgContest.Repo.Migrations.CreateDockerImages do
  use Ecto.Migration

  def change do
    create table(:docker_images) do
      add :language, :text, null: false
      add :image_id, :text, null: false
      add :quiz_id, references(:quizzes, on_delete: :restrict), null: false

      timestamps(type: :timestamptz)
    end

    create index(:docker_images, [:quiz_id, :language], unique: true)
  end
end
